Ext.define("org.jks.CreateFolderWindow", {
			extend : "Ext.panel.Panel",
			width : 330,
			height : 70,
			closable : true,
			title : "创建文件夹",
			callback: undefined,
			url: '',
			basePath: '',
			floating : true,
			initComponent : function() {
				var me = this;
				var form = Ext.create("Ext.form.Panel",{
					border : false,
					layout: 'hbox',
					margin: '5 5',
					items : [{
						xtype : 'textfield',
						labelWidth: 40,
						id: me.id + '_name',
						regex: new RegExp("^[a-zA-Z0-9]+$"),
						regexText: '名称只能为字母和数字组成',
						allowBlank: false,
						fieldLabel: '名称'
					},{
						xtype: 'button',
						width: 100,
						text: '添加',
						listeners:{
							click: function(){
								if(!form.isValid()){
									Ext.Msg.alert('错误', '名称不符合规范');
									return;
								}
								form.submit({
									url : me.url,
									params: {
										name: Ext.getCmp(me.id + '_name').getValue(),
										base: me.basePath
									},
									waitMsg : '后台正在处理, 请稍等 ...',
									success : function(form, action) {
										if(!Ext.isEmpty(me.callback)){
											me.callback();
										}
										me.close();
									},
									failure: function(form, action){
										if(!action.result.success){
											Ext.Msg.alert("错误", action.result.msg);
										}
									}
								})
							}
						}
					}]
				});
				me.items = [form]
				me.callParent();
			}
		});